#include "matriz.h"

void mul(const Matriz& A, const Matriz& B, Matriz& res, int n)
{
	forn(i, n)
	{
		forn(j, n)
		{
			double aux = 0;
			
			forn(k, n)
				aux += A[i][k] * B[k][j];
			
			res[i][j] = aux;
		}
	}
	
	return;
}

void mostrarMatriz(const Matriz& M, int n)
{    
    forn(i, n)
    {
	   	forn(j, n)
            cout << M[i][j] << " ";
        cout << endl;
    }    
}

void mostrarMatrizAlpha(const Matriz& M, int n)
{    
    cout << "(";
    forn(i, n-1)
    {
		cout << "(";
        forn(j, n-1)
            cout << M[i][j] << ", ";
            
        cout << M[i][n-1];
        
        cout << ")," << endl;
    }
    
    cout << "(";
	forn(j, n-1)
		cout << M[n-1][j] << ", ";
		
	cout << M[n-1][n-1] << "))" << endl;
}

void generarMatriz(Matriz& m, int n)
{
	forn(i, n)
	{		
		generarVector(m[i], n);
	}	
	
	return;
}
